﻿// Copyright (c) Toni Solarin-Sodara
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace Coverlet.Collector.Utilities.Interfaces
{
  internal interface IFileHelper
  {
    /// <summary>
    /// Determines whether the specified file exists.
    /// </summary>
    /// <param name="path">The file to check.</param>
    /// <returns>true if the caller has the required permissions and path contains the name of an existing file; otherwise, false.
    /// This method also returns false if path is null, an invalid path, or a zero-length string.
    /// If the caller does not have sufficient permissions to read the specified file,
    /// no exception is thrown and the method returns false regardless of the existence of path.</returns>
    bool Exists(string path);

    /// <summary>
    /// Creates a new file, writes the specified string to the file, and then closes the file.
    /// If the target file already exists, it is overwritten.
    /// </summary>
    /// <param name="path">The file to write to.</param>
    /// <param name="contents">The string to write to the file.</param>
    void WriteAllText(string path, string contents);
  }
}
